home *** CD-ROM | disk | FTP | other *** search
/ Aminet 25 / Aminet 25 (1998)(GTI - Schatztruhe)[!][Jun 1998].iso / Aminet / gfx / 3d / IIB10.lha / IIB / Threads / New_Jitter.irx < prev    next >
Encoding:
Internet Message Format  |  1998-02-16  |  6.4 KB

  1. Date:         Mon, 3 Nov 1997 23:43:23 +0100
  2. From: Ernesto Poveda Poveda Cortes <ernie@ARRAKIS.ES>
  3. Subject:      [IML] AREXX: New Jitter.irx With GUI!
  4.  
  5. Hi Arexx folks!
  6.  
  7. I have send a GUI version of Jitter.irx to Conny and he said me that it will
  8. be on his pages soon.
  9. I need you all to test it and help me in one question: I need to open GUI on
  10. Imagine Screen, but it is opened always in Workbench.
  11. I am using (so, you need this) MUIRexx to do the GUI.
  12.  
  13. ---------------------------------
  14.  
  15. Date:         Wed, 5 Nov 1997 11:55:36 -0700
  16. From: Brian Jones <bjones@cadvision.com>
  17.  
  18. You will have to promote Imagine's screen (which is private) to be
  19. a public screen. Use ModePro or TruePub.
  20.  
  21. -Brian
  22.  
  23. >> This is obsolete if you using IFA5.1 or later. It opens a own public
  24. screen <<
  25.  
  26. ---------------------------------
  27.  
  28. Date: Thu, 06 Nov 1997 22:30:57 +0100
  29. From: Ernesto Poveda Poveda Cortes <ernie@ARRAKIS.ES>
  30.  
  31. El 04-nov-97, Salvatore Cagliari escribi=F3:
  32.  
  33. >Hi Ernesto
  34.  
  35. >Can you send a copy to please? At this time, i don't have time to try it=
  36. , but
  37. >this would be the first thing to try, when i have time.
  38.  
  39. >Thanks you
  40. >Salvatore
  41.  
  42. Of course, here you have (attached :-))
  43. If you want to have it into Imagine's own screen use TruePub to promote
  44. Imagine's Screen to public mode.
  45. Remember also that you will need MUIRexx 3.0+ to use this proggy...
  46.  
  47. Hope you like this script!!
  48.  
  49. Ernesto.
  50. mailto: ernie@arrakis.es
  51.  
  52. /*
  53. **  $VER: JitterMUI.rexx 0.004 (23 Oct 1997)  **
  54. **
  55. **      (c) 1997 Ernesto Poveda Cortes
  56. **
  57. **  PROGRAMNAME:
  58. **      JitterMUI.rexx
  59. **
  60. **  FUNCTION:
  61. **      Randomizes object points by an offset given.
  62. **      :: This is an Imagine 5+ Script ::
  63. **      ** Needs to live in ImRexx: (Assign)
  64. **
  65. **  $HISTORY:
  66. **
  67. **  23 Oct 1997 :  0.04 :  Full working.
  68. **  23 Oct 1997 :  0.03 :  fighting agains MUI!
  69. **  23 Oct 1997 :  0.01 : initial release
  70. */
  71.  
  72. portname=3D'JITTER'
  73.  
  74. if show(P,portname) then do
  75.     address VALUE portname
  76.     "SHOW"
  77. end;else do
  78.     address "COMMAND" "Run <NIL: >NIL: MUIREXX:MUIRexx PORT" portname
  79.     address "COMMAND" "WaitForPort" portname
  80. end
  81.  
  82. address JITTER
  83.  
  84. MUIA_Gauge_Current =3D 0x8042f0dd
  85. MUIA_Gauge_Max =3D 0x8042bcdb
  86. MUIA_Gauge_Horiz =3D 0x804232dd
  87. MUIA_Window_CloseGadget =3D 0x8042a110
  88. MUIA_Window_Width =3D 0x8042dcae
  89. MUIA_Slider_Max =3D 0x8042d78a
  90. MUIA_Slider_Level =3D 0x8042ae3a
  91. MUIA_Group_HorizSpacing =3D 0x8042c651
  92. MUIA_Window_SizeGadget =3D 0x8042e33d
  93. FALSE =3D 0
  94. TRUE =3D 1
  95. MUIA_Disabled =3D 0x80423661
  96. Notify =3D 0x8042c9cb
  97. MUII_CheckMark =3D 15
  98. MUIA_Timer =3D 0x80426435
  99. MUIV_EveryTime =3D 0x49893131
  100. Selected =3D 0x8042654b
  101.  
  102. options results
  103. comando=3D''
  104. xx=3D10
  105. yy=3D10
  106. zz=3D10
  107. Smooth=3D1     /* Attention!!! 1=3DDisabled 0=3DEnabled!!!*/
  108. SmoothLock=3D0 /* Attention!!! 0=3DDisabled 1=3DEnabled!!!*/
  109. SmoothValue=3D5
  110.  
  111.  
  112. parse arg comando w y z Smooth SmoothLock SmoothValue
  113. select
  114.     when comando =3D 'GO' then do
  115.          address JITTER slider ID SX
  116.          w=3Dresult
  117.          address JITTER slider ID SY
  118.          y=3Dresult
  119.          address JITTER slider ID SZ
  120.          z=3Dresult
  121.          address JITTER check ID smoo
  122.          Smooth=3Dresult
  123.          address JITTER check ID chk2
  124.          SmoothLock=3Dresult
  125.          address JITTER popslider ID pop1
  126.          SmoothValue=3Dresult
  127.          call jitter
  128.          call BYE
  129.          end
  130.     when comando =3D 'FAST' then call jitter
  131.     when comando =3D '' then call jitter_gui
  132.     otherwise say comando
  133. end
  134.  
  135. exit
  136.  
  137. /* ------------------------------------------------------------------- */=
  138.  
  139.  
  140. jitter_gui:
  141. window ID JIT1 COMMAND """quit""" PORT JITTER TITLE """Jitter.irx"""
  142.  group REGISTER LABELS "Offsets,Smooth options"
  143.  group
  144.   group HORIZ
  145.     label LEFT "X"
  146.     slider ID SX ATTRS MUIA_Slider_Max 255 MUIA_Slider_Level 10
  147.   endgroup
  148.   group HORIZ
  149.     label LEFT "Y"
  150.     slider ID SY ATTRS MUIA_Slider_Max 255 MUIA_Slider_Level 10
  151.   endgroup
  152.   group HORIZ
  153.     label LEFT "Z"
  154.     slider ID SZ ATTRS MUIA_Slider_Max 255 MUIA_Slider_Level 10
  155.   endgroup
  156.  endgroup
  157.  group
  158.    group ID sm1
  159.     group HORIZ
  160.      check ID SMOO COMMAND """group ID SM2 ATTRS "MUIA_Disabled" %s;""" P=
  161. ORT JITTER HELP """Enable/Disable Smooth Tool after randomiZer""" LABEL "=
  162. 1,0"
  163.      label LEFT "Smooth Object?"
  164.      space HORIZ 82
  165.     endgroup
  166.     group ID SM2 HORIZ
  167.       check ID chk2 HELP """if checked, i will use the Lock option""" LAB=
  168. EL "0,1"
  169.       label "Smooth Lock?"
  170.       popslider ID pop1 HELP """This set the iterations passed \nto the s=
  171. mooth rutine""" ATTRS MUIA_Slider_Level 5
  172.       label "How Much?"
  173.     endgroup
  174.    endgroup
  175.   endgroup
  176.   endgroup
  177.  group HORIZ
  178.  button PRESS COMMAND '"ImRexx:JitterMUI.irx GO"' LABEL "Ok!"
  179.  button PRESS COMMAND """QUIT""" PORT JITTER LABEL "Cancel!"
  180.  endgroup
  181. endwindow
  182. group ID SM2 ATTRS MUIA_Disabled 1
  183. return
  184.  
  185. /* ------------------------------------------------------------------- */=
  186.  
  187.  
  188. jitter:
  189.  
  190. text_warn1=3D"\033cPlease use me with \n\033c\033bImagine 5.0+"
  191. text_warn2=3D"\033cX=3D0 & Y=3D0 & Z=3D0 ??\n\033cYou Must use at least *=
  192. one* non zero value"
  193.  
  194.  window ID JIT1 CLOSE
  195.  if ~show(P,'Imagine.1') then
  196.  do
  197.     call warn text_warn1
  198.     call BYE
  199.  end
  200.  
  201.  if ((w=3D=3D0) & (z=3D=3D0) & (y=3D=3D0)) then do
  202.     call warn text_warn2
  203.     call BYE
  204.  end
  205.  
  206.  window ID WORK1 PORT JITTER TITLE """Working..."""
  207.   space horiz 200
  208.   group FRAME
  209.    gauge ID GG1 ATTRS MUIA_Gauge_Horiz TRUE MUIA_Gauge_Max 100 MUIA_Gauge=
  210. _Current 1
  211.    object CLASS "Scale.mui"
  212.    button ID Abort1 PRESS PORT JITTER LABEL "Abort"
  213.   endgroup
  214.  endwindow
  215.  
  216.  
  217. CALL ADDLIB('rexxmathlib.library',0,-30,0)
  218.  
  219. ADDRESS 'Imagine.1'
  220.  
  221. displayrexxptr ON
  222. transform_translate 0 0 0  /*This will make the undo works :-)*/
  223. getgeometry
  224. getaxisinfo
  225.  
  226. /* Diferent calls, diferent objects ...*/
  227. blaaa=3Drandom(,,time(s))
  228.  
  229. address JITTER gauge ID GG1 MUIA_Gauge_Max pnt_num
  230.  
  231. do i=3D 1 to pnt_num
  232.    if w>0 then pnt_x.i =3D pnt_x.i+ random(0,w)
  233.    if y>0 then pnt_y.i =3D pnt_y.i+ random(0,y)
  234.    if z>0 then pnt_z.i =3D pnt_z.i+ random(0,z)
  235.    address JITTER gauge ID GG1 MUIA_Gauge_Current i
  236.    address JITTER button ID Abort1 Selected
  237.    if result=3D1 then call BYE
  238. end
  239.  
  240. setgeometry
  241.  
  242. if smooth=3D0 then do
  243.    if smoothlock=3D1 then smoothingtoollock smoothvalue
  244.                    else smoothingtool smoothvalue
  245.    end
  246.  
  247. return /* Jejejejejeje */
  248.  
  249. /*-------------------------------------------------*/
  250.  
  251. WARN:
  252. parse arg W1
  253.  address JITTER request ID Warn1 Gadgets "Damn!" W1
  254. return
  255.  
  256. BYE:
  257. address JITTER
  258.   window id jit1 close
  259.   window id work1 close
  260.   quit
  261. address 'Imagine.1'
  262.   ActivateImagine
  263.   displayrexxptr OFF
  264.   ImaginetoFront
  265. EXIT
  266.